import request from '@/utils/request'

export function generatePackageSn(query) {
  return request({
    url: '/package/generatePackageSn',
    method: 'get',
    params: query
  })
}

export function listPackage(query) {
  return request({
    url: '/package/list',
    method: 'get',
    params: query
  })
}

export function detailPackage(query) {
  return request({
    url: '/package/details',
    method: 'get',
    params: query
  })
}

export function updateOnSale(query) {
  return request({
    url: '/package/update-onSale',
    method: 'get',
    params: query
  })
}

export function addPackage(data) {
  return request({
    url: '/package/add',
    method: 'post',
    data
  })
}

export function updatePackage(data) {
  return request({
    url: '/package/update',
    method: 'put',
    data
  })
}

export function deletePackageById(query) {
  return request({
    url: '/package/delete',
    method: 'delete',
    params: query
  })
}

export function addPackageGoods(data) {
  return request({
    url: '/package/addPackageGoods',
    method: 'post',
    data
  })
}

export function listPackageGoods(query) {
  return request({
    url: '/package/listPackageGoods',
    method: 'get',
    params: query
  })
}

export function deletePackageGoods(query) {
  return request({
    url: '/package/deletePackageGoods/'+query,
    method: 'delete'
  })
}

//套餐类目
export function addPackageCategory(data) {
  return request({
    url: 'packageCategory/add',
    method: 'post',
    data
  })
}
export function listPackageCategory(query) {
  return request({
    url: 'packageCategory/list',
    method: 'get',
    params: query
  })
}

export function goodsListPackageCategory(query) {
  return request({
    url: 'packageCategory/goods-list',
    method: 'get',
    params: query
  })
}

export function deletePackageCategory(query) {
  return request({
    url: 'packageCategory/delete/'+query,
    method: 'delete'
  })
}
